<template>
	<view>
		<uni-search-bar placeholder="搜索图书馆"></uni-search-bar>
		<uni-card @click="dianji(item.id)" v-if="item.businessState == 1" v-for="(item,index) in list" :title="item.name" style="background-color: #eae5c7;">
			<view class="">
				地址：{{item.address}}
			</view>
			<view class="">
				营业时间：{{item.businessHours}}
			</view>
			<view class="">
				营业状态：营业中
			</view>
		</uni-card>
		<uni-card @click="dianji(item.id)" v-if="item.businessState == 0" v-for="(item,index) in list" :title="item.name" style="background-color: #eae5c7;">
			<view class="">
				地址：{{item.address}}
			</view>
			<view class="">
				营业时间：{{item.businessHours}}
			</view>
			<view class="">
				营业状态：打烊
			</view>
		</uni-card>
	</view>
</template>

<script>
	import api from 'commer/apiURL.js'
	export default {
		data() {
			return {
				base:api.baseurl,
				list:[]
			}
		},
		onLoad() {
			this.getlun()
		},
		methods: {
			dianji(id){
				uni.navigateTo({
					url:'xianq?id='+id
				})
			},
			getlun(){
				this.$get(this.base+'/prod-api/api/digital-library/library/list').then((res)=>{
					console.log(res)
					this.list = res.rows
				})
			}
		}
	}
</script>

<style>

</style>
